﻿
@{
    ViewBag.Title = "HiddenTroubleAdd";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css {
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <style>
        th {
            text-align: center;
            font-weight: bold;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }
    </style>
}
<div class="page-content" ng-cloak ng-controller="PlaceSafetyController" ng-init="SearchModel={};page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
     PageName='@Request.CurrentExecutionFilePath.Substring(Request.CurrentExecutionFilePath.LastIndexOf("/") + 1)';
     SearchModel.TypeId=1;
     GetParkList();
     GetMyPlacePageList(SearchModel,page);
     ">
    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />

			</path>
		</svg>
            <div class="load-msg" ng-bind="LoadingMsg"></div>
        </div>
    </div>
    <div class="page-heading">
        <h1>危险点</h1>
        <div class="options">
            <div class="btn-toolbar">

            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>主体业务</a></li>
        <li><a>场所安全</a></li>
        <li class="active"><a>危险点</a></li>
    </ol>

    <div class="container-fluid">
        <div class="row">
            <form class="form-horizontal row-border">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading"><h2>筛选条件</h2></div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-1 control-label">园区：</label>
                                <div class="col-sm-2">
                                    <select class="form-control" ng-model="SearchModel.ParkId" ng-change="GetBuildingList(SearchModel.ParkId);GetMyPlacePageList(SearchModel,1);">
                                        <option value="">所有园区</option>
                                        <option ng-repeat="x in ParkList" value="{{x.Id}}">{{x.ParkName}}</option>
                                    </select>
                                </div>
                                <label class="col-sm-1 control-label">建筑物：</label>
                                <div class="col-sm-2">
                                    <select class="form-control" ng-model="SearchModel.BuildingId" ng-change="GetFloorList(SearchModel.BuildingId);GetMyPlacePageList(SearchModel,1);">
                                        <option value="">所有建筑物</option>
                                        <option ng-repeat="x in BuildingList" value="{{x.Id}}">{{x.BuildingName}}</option>
                                    </select>
                                </div>
                                <label class="col-sm-1 control-label">楼层：</label>
                                <div class="col-sm-2">
                                    <select class="form-control" ng-model="SearchModel.FloorId" ng-change="GetMyPlacePageList(SearchModel,1);">
                                        <option value="">所有楼层</option>
                                        <option ng-repeat="x in FloorList" value="{{x.Id}}">{{x.FloorName}}</option>
                                    </select>
                                </div>
                                <label class="col-sm-1 control-label">危险点名称：</label>
                                <div class="col-sm-2">
                                    <input type="text" ng-model="SearchModel.PlaceName" placeholder="楼层名称模糊查询" class="form-control" ng-change="GetMyPlacePageList(SearchModel,1);" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h2>危险点列表 总数：<b ng-bind="TotalCount"></b></h2>
                        <div class="panel-ctrls">
                            <div class="btn-group">
                               @* <a href="PlaceAdd?page={{result.currentPage}}&pagename={{PageName}}&type={{SearchModel.TypeId}}" class="btn btn-xs btn-primary"><i class="fa fa-plus"></i>添加危险点</a>*@
                            </div>
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="text-center" ng-show="PageLoading">
                            <img src="~/Assets/img/loading.gif" />
                        </div>
                        <table class="table table-striped table-bordered table-hover" ng-show="!PageLoading">
                            <thead>
                                <tr>
                                    <th>序号</th>
                                    <th>所属园区</th>
                                    <th>所属建筑物</th>
                                    <th>所属楼层</th>
                                    <th>房间名称</th>
                                    <th>危险点</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-show="PlacePageList.length==0 && !PageLoading">
                                    <td colspan="12" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                                </tr>
                                <tr ng-repeat="x in PlacePageList">
                                    <td>
                                        <span ng-bind="$index+1"></span>
                                    </td>
                                    <td>
                                        <span>{{x.ParkInfo.ParkName}}</span>
                                    </td>
                                    <td>
                                        <span>{{x.BuildingInfo.BuildingName}}</span>
                                    </td>
                                    <td>
                                        <span>{{x.FloorInfo.FloorName}}</span>
                                    </td>
                                    <td>
                                        <span>{{x.RoomInfo.RoomName}}</span>
                                    </td>
                                    <td>
                                        <span>{{x.PlaceName}}</span>
                                    </td>
                                    <td><span class="badge badge-primary">{{x.Valid | GetBoolStr}}</span></td>
                                    <td>
                                        <a ng-show="@ViewBag.IsAdd==1" href="PlaceCheckFormAdd?RoomId={{x.RoomId}}&PlaceId={{x.Id}}&PlaceName={{x.PlaceName}}&pagename={{PageName}}&type={{SearchModel.TypeId}}&page={{result.currentPage}}" class="btn btn-default btn-xs btn-label"><i class="fa fa-check-square-o"></i>检查</a>
                                        <a ng-show="@ViewBag.IsAdd==1" href="EquipmentList?RoomId={{x.RoomId}}&page={{page}}&pagename={{PageName}}&type={{SearchModel.TypeId}}" class="btn btn-primary btn-xs btn-label"><i class="fa fa-desktop"></i>设施设备</a>
                                        <a href="PlaceRiskList?PlaceId={{x.Id}}&PlaceName={{x.PlaceName}}&pagename={{PageName}}&type={{SearchModel.TypeId}}" class="btn btn-success btn-xs btn-label"><i class="fa fa-flash"></i>风险措施</a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="text-center" ng-show="PlacePageList!=null && PlacePageList.length>0">
                    <ul class="pagination  justify-content-center">
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetMyPlacePageList(SearchModel,1);">首页</a></li>
                        <li class="page-item" ng-class="{'active':result.currentPage==page}" ng-repeat="page in result.pages"><a style="cursor:pointer;" ng-click="GetMyPlacePageList(SearchModel,page)" class="page-link" ng-bind="page"></a></li>
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetMyPlacePageList(SearchModel,(result.currentPage + 1 > result.totalPage ? result.totalPage : result.currentPage + 1))">下一页</a></li>
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetMyPlacePageList(SearchModel,result.totalPage);">尾页</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

</div>


@section Js{
    <script src="~/Assets/js/pg/PlaceSafety.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
}
